package com.ftg.learn.day06;

/**
 * 三角形
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/7/14 上午10:20
 */
public class Triangle {

    public static void question1() {
        for (int i = 0; i < 10; i++) {
            for (int i1 = 0; i1 < 10; i1++) {
//                System.out.print(i1 <= i ? "*\t" : " \t");
//                System.out.print(i1 >= i ? "*\t" : " \t");
                System.out.print(i1 <= 9 - i ? "*\t" : " \t");
//                System.out.print(i1 <= 9 - i ? "*\t" : " \t");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        for (int i = 0; i < 9; i++) {
            for (int i1 = 0; i1 < 9; i1++) {
                int middle = 9 >> 1;
                System.out.print(i1 < middle - i || i1 > middle + i ? " \t" : "*\t");
            }
            System.out.println();
        }
    }

}
